package com.newtribe.loader;

import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;



public class ExternalFileClassLoader extends URLClassLoader {
   public ExternalFileClassLoader(URL[] urls, ClassLoader parent,
                                  URLStreamHandlerFactory factory) {
     super(urls, parent, factory);
   }

   public ExternalFileClassLoader(URL[] urls, ClassLoader parent) {
     super(urls, parent);
   }

   public ExternalFileClassLoader(URL[] urls) {
     super(urls);
   }
   @Override
   public void addURL(URL url) {
		 super.addURL(url);
}
   
   
   public synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException{
	   return super.loadClass(name ,resolve) ;
   }

 public static void main(String[] argvs) throws Exception {
//   if(test())
//     return ;
   ClassLoader sysLoader =ClassLoader.getSystemClassLoader() ;
   
   URL[] urls =new URL[3] ;
   urls[0] = new URL("file:///D:/axis.jar");
   urls[1] = new URL("file:///D:/jaxrpc.jar");
   urls[2] = new URL("file:///D:/axis.jar");
   ExternalFileClassLoader loader = new ExternalFileClassLoader(urls, null);
  
Class clazz= loader.loadClass("org.apache.axis.client.Service"  ) ;
 // Class clazz= loader.loadClass("com.newtribe.loader.LChar"  ) ;
  Object objInstance =clazz.newInstance() ;


 }
}